<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript">
function click_func(obj, myid){
	//点击时，如果取得的值和搜索框默认value值相同，则将搜索框清空
	if (document.getElementById(myid).value == document.getElementById(myid).defaultValue){
	  document.getElementById(myid).value = '';
	  obj.style.color='#000';
	}
}
//鼠标不聚焦在搜索框时执行
function blur_func(obj, myid){
	//鼠标失焦时，如果搜索框没有输入值，则用搜索框的默认value值填充
	if (document.getElementById(myid).value == ''){
	 document.getElementById(myid).value = document.getElementById(myid).defaultValue;
	 obj.style.color='#666';
 }
}
</script>
<div>
	<form action="${pageContext.request.contextPath}/pageDisplay/resultPage.jsp" method="get">
		<table>
			<tr>
				<td>
					<input type="text" name="textfield" id="textfield" value="请输入商品名"
					onmouseover="this.focus();"
					onclick="click_func(this, 'textfield');"
					onBlur="blur_func(this, 'textfield');"/>
				</td>
				<td>
					<input type="submit" value="go" />
				</td>
			</tr>
		</table>
	</form>
</div>